<%@ page import="com.education.service.bean.ActivityBean" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Fan307
  Date: 2016/11/22
  Time: 16:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>addCourseFolder.jsp</title>
</head>
<body>
<script type="text/javascript">
    function getSelectedFolder() {
        var catagory = document.getElementById("catagoryFolder").value;
        var school = document.getElementById("schoolFolder").value;
        var major = document.getElementById("majorFolder").value;
        var course = document.getElementById("CourseFolder").value;
        var coursefolder = catagory + "\\" + school + "\\" + major + "\\" + course + "\\";
        alert(coursefolder);

        window.location.href = "/admin/addCourseFolder1.jsp?courseFolder=" + coursefolder;

    }

</script>
<h3>选择要新建Course文件夹的上级目录</h3>
<div >
    <select id="catagoryFolder" name="catagoryName">
        <%
            List<ActivityBean> infoCatagortyBean = (List) request.getAttribute("infocatagorybean");
            if(infoCatagortyBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoCatagortyBean.size();i++)
                {
                    String catagoryValue = infoCatagortyBean.get(i).getValue();
                    String catagoryName = infoCatagortyBean.get(i).getName();
        %>
        <option value="<%=catagoryValue%>"><%=catagoryValue%></option>
        <%
                }
            }
        %>
    </select>

    <select id="schoolFolder" name="schoolName">
        <%
            List<ActivityBean> infoSchoolBean = (List) request.getAttribute("infoschoolbean");
            if(infoSchoolBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoSchoolBean.size();i++)
                {
                    String schoolValue = infoSchoolBean.get(i).getValue();
                    String schoolName = infoSchoolBean.get(i).getName();
        %>
        <option value="<%=schoolValue%>"><%=schoolValue%></option>
        <%
                }
            }
        %>
    </select>
    <select id="majorFolder" name="majorName">
        <%
            List<ActivityBean> infoMajorBean = (List) request.getAttribute("infomajorbean");
            if(infoMajorBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoMajorBean.size();i++)
                {
                    String majorValue = infoMajorBean.get(i).getValue();
                    String majorName = infoMajorBean.get(i).getName();
        %>
        <option value="<%=majorValue%>"><%=majorValue%></option>
        <%
                }
            }
        %>
    </select>
    <input type="text"  id="CourseFolder" />
    <input type="button" value="确定" onclick="getSelectedFolder()"/>


</div>

</body>
</html>
